﻿<UserControl x:Class="EpiDashboard.DashboardControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dashboard="clr-namespace:EpiDashboard"
    xmlns:Controls="clr-namespace:EpiDashboard.Controls"
    Height="700" Width="900" Background="White">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="ResourceDictionary.xaml"/>
                <ResourceDictionary Source="StyleDictionary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    
    <Grid x:Name="grdMain">
        <Grid.RowDefinitions>
            <RowDefinition Height="48"></RowDefinition>
            <RowDefinition Height="0"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="1"></RowDefinition>
            <RowDefinition Height="1"></RowDefinition>
            <RowDefinition Height="20"></RowDefinition>
        </Grid.RowDefinitions>

        <!--<DockPanel Grid.Row="1" Background="#CBCFD4"></DockPanel>-->

        <Controls:GadgetInfoPanel x:Name="infoPanel" Grid.Row="2" Margin="4" Visibility="Collapsed" />

        <DockPanel SnapsToDevicePixels="True" Grid.Row="0">
            <Grid>
                <Rectangle Style="{DynamicResource shadowRectangle}"></Rectangle>
                <DockPanel Background="{DynamicResource PrimaryAccentColorLight}">
                    <Grid x:Name="grdMenuBarInner">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width=".05*"/>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width=".05*" MaxWidth="32" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <DockPanel x:Name="iconFile" Style="{StaticResource menuIconStyle}" Grid.Column="0" MouseLeftButtonUp="iconFile_MouseLeftButtonUp">
                            <DockPanel.ToolTip>
                                <StackPanel>
                                    <Label x:Name="tooltipFileHeader" FontWeight="Bold">Options Button</Label>
                                    <TextBlock x:Name="tooltipFile"
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Shows a menu of options for the Dashboard application.</TextBlock>
                                </StackPanel>
                            </DockPanel.ToolTip>
                            <Grid Height="36" Width="36">
                                <Path Width="18" Height="18" Stretch="Fill" Fill="White" Data="F1 M 19,23L 27,23L 27,31L 19,31L 19,23 Z M 19,34L 27,34L 27,42L 19,42L 19,34 Z M 31,23L 57,23L 57,31L 31,31L 31,23 Z M 19,45L 27,45L 27,53L 19,53L 19,45 Z M 31,34L 57,34L 57,42L 31,42L 31,34 Z M 31,45L 57,45L 57,53L 31,53L 31,45 Z "/>
                                <Ellipse Stroke="White" Fill="Transparent" StrokeThickness="3" />
                            </Grid>
                        </DockPanel>

                        <DockPanel x:Name="iconRefresh" Style="{StaticResource menuIconStyle}" Grid.Column="1" MouseLeftButtonUp="iconRefresh_MouseLeftButtonUp">
                            <DockPanel.ToolTip>
                                <StackPanel>
                                    <Label x:Name="tooltipRefreshHeader" FontWeight="Bold">Refresh Button</Label>
                                    <TextBlock x:Name="tooltipRefresh"
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Re-connects to the data source and downloads the latest available data.</TextBlock>
                                </StackPanel>
                            </DockPanel.ToolTip>
                            <Grid Height="36" Width="36">
                                <Path Width="18" Height="18" Stretch="Fill" Fill="White" Data="F1 M 38,20.5833C 42.9908,20.5833 47.4912,22.6825 50.6667,26.046L 50.6667,17.4167L 55.4166,22.1667L 55.4167,34.8333L 42.75,34.8333L 38,30.0833L 46.8512,30.0833C 44.6768,27.6539 41.517,26.125 38,26.125C 31.9785,26.125 27.0037,30.6068 26.2296,36.4167L 20.6543,36.4167C 21.4543,27.5397 28.9148,20.5833 38,20.5833 Z M 38,49.875C 44.0215,49.875 48.9963,45.3932 49.7703,39.5833L 55.3457,39.5833C 54.5457,48.4603 47.0852,55.4167 38,55.4167C 33.0092,55.4167 28.5088,53.3175 25.3333,49.954L 25.3333,58.5833L 20.5833,53.8333L 20.5833,41.1667L 33.25,41.1667L 38,45.9167L 29.1487,45.9167C 31.3231,48.3461 34.483,49.875 38,49.875 Z "/>
                                <Ellipse Stroke="White" Fill="Transparent" StrokeThickness="3" />
                            </Grid>
                        </DockPanel>

                        <DockPanel x:Name="iconDb" Style="{StaticResource menuIconStyle}" Grid.Column="3" MouseLeftButtonUp="iconDb_MouseLeftButtonUp">
                            <DockPanel.ToolTip>
                                <StackPanel>
                                    <Label x:Name="tooltipSetDataSourceHeader" FontWeight="Bold">Set Data Source Button</Label>
                                    <TextBlock x:Name="tooltipSetDataSource"
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Attaches a data source (Epi Info 7 project, Excel spreadsheet, etc.) to a new, blank Dashboard canvas.</TextBlock>
                                </StackPanel>
                            </DockPanel.ToolTip>
                            <Grid Height="36" Width="36">
                                <Path Width="18" Height="18" Stretch="Fill" Fill="White" Data="F1 M 38,19C 47.619,19 55.4167,21.1266 55.4167,23.75C 55.4167,24.9666 53.7397,26.0763 50.9819,26.9167C 47.7927,27.8884 43.1582,28.5 38,28.5C 32.8418,28.5 28.2073,27.8884 25.0181,26.9167C 22.2603,26.0763 20.5833,24.9666 20.5833,23.75C 20.5833,21.1266 28.381,19 38,19 Z M 55.4167,52.25C 55.4167,54.8734 47.6189,57 38,57C 28.381,57 20.5833,54.8734 20.5833,52.25L 20.5833,45.9167C 20.5833,48.54 28.381,50.6667 38,50.6667C 47.6189,50.6667 55.4167,48.54 55.4166,45.9167L 55.4167,52.25 Z M 55.4167,42.75C 55.4167,45.3734 47.619,47.5 38,47.5C 28.381,47.5 20.5833,45.3734 20.5833,42.75L 20.5833,36.4167C 20.5833,39.04 28.381,41.1667 38,41.1667C 47.619,41.1667 55.4167,39.04 55.4166,36.4167L 55.4167,42.75 Z M 55.4167,33.25C 55.4167,35.8733 47.619,38 38,38C 28.3811,38 20.5833,35.8733 20.5833,33.25L 20.5833,26.9167C 20.5833,29.54 28.381,31.6667 38,31.6667C 47.619,31.6667 55.4167,29.54 55.4167,26.9167L 55.4167,33.25 Z "/>
                                <Ellipse Stroke="White" Fill="Transparent" StrokeThickness="3" />
                                <!--<Image Source="Images/SetDataSource.png" Height="32" Width="32" />-->
                            </Grid>
                        </DockPanel>

                        <DockPanel x:Name="iconOpen" 
                                   Style="{StaticResource menuIconStyle}" Grid.Column="4" MouseLeftButtonUp="iconOpen_MouseLeftButtonUp">
                            <DockPanel.ToolTip>
                                <StackPanel>
                                    <Label x:Name="tooltipOpenHeader" FontWeight="Bold">Open Button</Label>
                                    <TextBlock x:Name="tooltipOpen"
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Opens an existing Dashboard canvas file.
                                    </TextBlock>
                                </StackPanel>
                            </DockPanel.ToolTip>
                            <Grid Height="36" Width="36">
                                <Path Width="22" Height="18" Stretch="Fill" Fill="White" Data="F1 M 19,50L 28,34L 63,34L 54,50L 19,50 Z M 19,28.0001L 35,28C 36,25 37.4999,24.0001 37.4999,24.0001L 48.75,24C 49.3023,24 50,24.6977 50,25.25L 50,28L 53.9999,28.0001L 53.9999,32L 27,32L 19,46.4L 19,28.0001 Z "/>
                                <Ellipse Stroke="White" Fill="Transparent" StrokeThickness="3" />
                            </Grid>
                        </DockPanel>

                        <DockPanel x:Name="iconSave"
                                   Style="{StaticResource menuIconStyle}"
                                   Grid.Column="5" MouseLeftButtonUp="iconSave_MouseLeftButtonUp">
                            <DockPanel.ToolTip>
                                <StackPanel>
                                    <Label x:Name="tooltipSaveHeader" FontWeight="Bold">Save Button</Label>
                                    <TextBlock x:Name="tooltipSave"
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Saves the current Dashboard canvas.
                                    </TextBlock>
                                </StackPanel>
                            </DockPanel.ToolTip>
                            <Grid Height="36" Width="36">
                                <Path Width="18" Height="18" Stretch="Fill" Fill="White" Data="F1 M 20.5833,20.5833L 55.4167,20.5833L 55.4167,55.4167L 45.9167,55.4167L 45.9167,44.3333L 30.0833,44.3333L 30.0833,55.4167L 20.5833,55.4167L 20.5833,20.5833 Z M 33.25,55.4167L 33.25,50.6667L 39.5833,50.6667L 39.5833,55.4167L 33.25,55.4167 Z M 26.9167,23.75L 26.9167,33.25L 49.0833,33.25L 49.0833,23.75L 26.9167,23.75 Z "/>
                                <Ellipse Stroke="White" Fill="Transparent" StrokeThickness="3" />
                            </Grid>
                        </DockPanel>

                        <DockPanel x:Name="iconSaveAs"
                                   Style="{StaticResource menuIconStyle}"
                                   Grid.Column="6" MouseLeftButtonUp="iconSaveAs_MouseLeftButtonUp">
                            <DockPanel.ToolTip>
                                <StackPanel>
                                    <Label x:Name="tooltipSaveAsHeader" FontWeight="Bold">Save As Button</Label>
                                    <TextBlock x:Name="tooltipSaveAs"
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Saves the current canvas with a new name.
                                    </TextBlock>
                                </StackPanel>
                            </DockPanel.ToolTip>
                            <Grid Height="36" Width="36">
                                <Path Width="16" Height="16" Margin="0, 2, -4, 0" Stretch="Fill" Fill="White" Data="F1 M 20.5833,20.5833L 55.4167,20.5833L 55.4167,55.4167L 45.9167,55.4167L 45.9167,44.3333L 30.0833,44.3333L 30.0833,55.4167L 20.5833,55.4167L 20.5833,20.5833 Z M 33.25,55.4167L 33.25,50.6667L 39.5833,50.6667L 39.5833,55.4167L 33.25,55.4167 Z M 26.9167,23.75L 26.9167,33.25L 49.0833,33.25L 49.0833,23.75L 26.9167,23.75 Z "/>
                                <Ellipse Stroke="White" Fill="Transparent" StrokeThickness="3" />
                                <!--<TextBlock Foreground="White" FontSize="24" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0, 2, 4, 0">*</TextBlock>-->
                                <Line X1="9" X2="9" Y1="9" Y2="23" Stroke="White" StrokeThickness="2"></Line>
                                <Line X1="8" X2="25" Y1="8" Y2="8" Stroke="White" StrokeThickness="2"></Line>
                            </Grid>
                        </DockPanel>

                        <DockPanel x:Name="iconCreateNewVariable"
                                   Style="{StaticResource menuIconStyle}"
                                   Grid.Column="7" MouseLeftButtonUp="iconCreateNewVariable_MouseLeftButtonUp">
                            <DockPanel.ToolTip>
                                <StackPanel>
                                    <Label x:Name="tooltipCreateVariableHeader" FontWeight="Bold">Create New Variable</Label>
                                    <TextBlock x:Name="tooltipCreateVariable"
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Expands the new variable gadget.
                                    </TextBlock>
                                </StackPanel>
                            </DockPanel.ToolTip>
                            <Grid Height="36" Width="36">
                                <Path Width="20" Height="19"  Stretch="Fill" Fill="White" Data="M194.5,278.2h191.8l0.2,117.8c0,0,2.2,12.5-10,13.5H204.3c0,0-11.8-0.8-9.8-12.7V278.2z"  />
                                <Path Width="18" Height="15"  Stretch="Fill" Fill="#016FC1" Data="M177,277.7v-18.2c0,0,1-21.7,23.8-24.8h71.7h91.2h16.8c0,0,20,1.2,23.5,23V326v54.2v20.7
		c0,0,1.2,20.7-23.2,25.5h-90.3h-83.3h-6.8c0,0-19.8-1.3-23.3-23.3v-72.5V277.7z"  />
                                <Path Width="14" Height="9"  Stretch="Fill" Fill="White" Data="M250.8,375.8h5.1c0,0-4,6.3-4.3,16.5c0,0-0.6,9,2.5,15.2l2.8,5.9h-4.8c0,0-6.5-9.6-6.5-16.5
		c0,0-1.3-8.2,2.8-16.8L250.8,375.8z M264.5,385.4l0.5-2.3c0,0,4.6-2.4,8.3-2.2c0,0,4.8-0.7,6.8,4.3l1.4,5l3.5-5.2c0,0,1.7-2.5,2.3-2.9
		c0,0,3.8-3.3,6.8-0.3c0,0,2.8,3.2-0.5,6.7c0,0-1.1,2-6.3,1l-2-0.7l-3.2,3.9l1.5,5.5l1.3,4c0,0,0.3,2.2,2.8,2.9c0,0,2,0.5,4.9-0.8
		l-0.5,2.4c0,0-4.5,1.9-5.4,1.9c0,0-5.3,1.1-7.6-0.9c0,0-1.6-0.5-3-5.6l-0.5-2.5h-0.4l-2.3,3.6c0,0-2.5,4.3-4.6,5.1
		c0,0-4,1.8-6.1-1.6c0,0-1.6-4.7,2.5-6.5c0,0,0.8-1.8,7.1,0.5l3.2-3.8l-2.3-8.3c0,0-1.1-3.5-3.7-4
		C268.9,384.7,266.8,384.7,264.5,385.4z M301,376h5.1c0,0,4.5,7.6,5,12.5c0,0,1,7.7-0.8,13.5c0,0-2,6.8-5.5,11.5h-5c0,0,4.3-8.6,4.4-10
		c0,0,1.5-7,1.2-11.9c0,0-1.5-10.4-2.5-11.7L301,376z" Stroke="White" StrokeThickness="0.3" />
                                
                               
                                <Ellipse Stroke="White" Fill="Transparent" StrokeThickness="3" />
                                <!--Ellipse Height="12" Width="12" Stroke="White" Fill="White" StrokeThickness="1" /-->
                                
                                <!--<TextBlock Foreground="White" FontSize="24" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0, 2, 4, 0">*</TextBlock>-->
                            </Grid>
                        </DockPanel>

                        <DockPanel x:Name="iconFilter"
                                   Style="{StaticResource menuIconStyle}"
                                   Grid.Column="8" MouseLeftButtonUp="iconFilter_MouseLeftButtonUp">
                            <DockPanel.ToolTip>
                                <StackPanel>
                                    <Label x:Name="tooltipFilterHeader" FontWeight="Bold">Add/Remove Filters</Label>
                                    <TextBlock x:Name="tooltipFilter"
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Expands the dashboard filters gadget.
                                    </TextBlock>
                                </StackPanel>
                            </DockPanel.ToolTip>
                            <Grid Height="36" Width="36">
                                <Ellipse Stroke="White" Fill="Transparent" StrokeThickness="3" />
                                <!--<TextBlock Foreground="White" FontSize="24" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0, 2, 4, 0">*</TextBlock>-->
                                <Line X1="8" X2="28" Y1="10" Y2="10" Stroke="White" StrokeThickness="2"></Line>
                                <Line X1="8" X2="28" Y1="12" Y2="12" Stroke="White" StrokeThickness="2"></Line>
                                <Line X1="9" X2="27" Y1="13" Y2="13" Stroke="White" StrokeThickness="2"></Line>
                                <Line X1="10" X2="26" Y1="14" Y2="14" Stroke="White" StrokeThickness="2"></Line>
                                <Line X1="11" X2="25" Y1="15" Y2="15" Stroke="White" StrokeThickness="2"></Line>
                                <Line X1="12" X2="24" Y1="16" Y2="16" Stroke="White" StrokeThickness="2"></Line>
                                <Line X1="13" X2="23" Y1="17" Y2="17" Stroke="White" StrokeThickness="2"></Line>
                                <Line X1="14" X2="22" Y1="18" Y2="18" Stroke="White" StrokeThickness="2"></Line>
                                <Line X1="15" X2="21" Y1="19" Y2="19" Stroke="White" StrokeThickness="2"></Line>
                                <Line X1="15" X2="21" Y1="21" Y2="21" Stroke="White" StrokeThickness="2"></Line>
                                <Line X1="15" X2="21" Y1="23" Y2="23" Stroke="White" StrokeThickness="2"></Line>
                                <Line X1="15" X2="21" Y1="25" Y2="25" Stroke="White" StrokeThickness="2"></Line>
                                <Line X1="15" X2="21" Y1="27" Y2="27" Stroke="White" StrokeThickness="2"></Line>
                            </Grid>
                        </DockPanel>

                        <StackPanel Grid.Column="9" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="8, 0, 8, 0">

                            <ComboBox x:Name="cmbView" SelectedIndex="0" FontSize="15" Visibility="Collapsed" SelectionChanged="cmbView_SelectionChanged" >
                                <ComboBoxItem>Analysis</ComboBoxItem>
                                <ComboBoxItem>Data</ComboBoxItem>
                                <ComboBoxItem>Variables</ComboBoxItem>
                                <!--<ComboBoxItem>Identify Duplicates</ComboBoxItem>-->
                            </ComboBox>
                        </StackPanel>

                        <Grid x:Name="grdDataSource" Visibility="Collapsed" Grid.Column="10" HorizontalAlignment="Right">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Border x:Name="borderDataSource" HorizontalAlignment="Stretch" Grid.Column="0" Grid.ColumnSpan="3" CornerRadius="0" BorderThickness="1" Background="{StaticResource PrimaryAccentColorVeryLight}" Margin="0, 3, 0, 3"></Border>

                            <StackPanel>
                                <TextBlock x:Name="tblockDataSourceLabel" Foreground="White" Grid.Column="0" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,4,0,4"><Bold>Data Source:</Bold></TextBlock>
                                <StackPanel Orientation="Horizontal" Margin="0, 0, 0, 4">
                                    <TextBlock x:Name="tblockDataSource" Foreground="White" Grid.Column="1" FontWeight="Light" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="11,0,11,0">Project / Form
                                        <TextBlock.ToolTip>
                                            <ToolTip>
                                                <TextBlock x:Name="tooltipDataSourceLabel"></TextBlock>
                                            </ToolTip>
                                        </TextBlock.ToolTip>
                                    </TextBlock>
                                    <TextBlock x:Name="tblockRecordCount" Foreground="White" Grid.Column="2" FontWeight="Light" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="11,0,11,0">(n records)</TextBlock>
                                </StackPanel>
                            </StackPanel>
                        </Grid>
                    </Grid>                    
                </DockPanel>
            </Grid>
        </DockPanel>        
        
        <Controls:NotificationPanel Visibility="Visible" IsHitTestVisible="False" x:Name="panelNotification" Grid.Row="3" Height="52" MinWidth="720" VerticalAlignment="Bottom"></Controls:NotificationPanel>

        <Image Margin="0, 10, 30, 0" Opacity="0.15" Width="79" Height="77" Source="Images/ei_logomark_256px.png"  Visibility="Visible" IsHitTestVisible="False" x:Name="imageWatermark" Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Top"/>

        <ScrollViewer Grid.Row="3" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True" x:Name="scrollViewer">
            <ScrollViewer.ContextMenu>
                <ContextMenu>
                    <MenuItem x:Name="mnuDataSource" Header="Set data source...">
                        <MenuItem.Icon>
                            <Image Source="Images/db_add.png" Stretch="Fill" Height="16px" Width="16px" />
                        </MenuItem.Icon>
                    </MenuItem>                    
                    <MenuItem x:Name="mnuAddRelatedData" Header="Add related data source..." />
                    <MenuItem x:Name="mnuOpen" Header="Open canvas..." />
                    <MenuItem x:Name="mnuSave" Header="Save canvas" />
                    <MenuItem x:Name="mnuSaveAs" Header="Save canvas as..." />
                    <Separator/>
                    <MenuItem x:Name="mnuSaveOutput" Header="Save output as HTML">
                        <MenuItem.Icon>
                            <Image Source="Images/saveHTML.png" Stretch="Fill" Height="16px" Width="16px" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem x:Name="mnuSendOutputTo" Header="Send output to" IsEnabled="False">
                        <MenuItem x:Name="mnuSendOutputToExcel" Header="Microsoft Excel" IsEnabled="False" />
                        <MenuItem x:Name="mnuSendOutputToWord" Header="Microsoft Word" IsEnabled="False" />
                    </MenuItem>
                    <MenuItem x:Name="mnuExport" Header="Export data" IsEnabled="False" />
                    <Separator/>
                    <MenuItem x:Name="mnuAddGadget" Header="Add Analysis Gadget">
                        <MenuItem.Icon>
                            <Image Source="Images/gadget.png" Stretch="None" />
                        </MenuItem.Icon>
                        <Controls:GadgetMenuItem x:Name="mnuLineList" Header="Line list" GadgetType="EpiDashboard.LineListControl" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnuRates" Header="Rates" GadgetType="EpiDashboard.RatesControl" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnuFrequency" Header="Frequency" GadgetType="EpiDashboard.FrequencyControl" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnuWordCloud" Header="Word cloud" GadgetType="EpiDashboard.WordCloudControl" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnuCombinedFrequency" Header="Combined frequency" GadgetType="EpiDashboard.CombinedFrequencyControl" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnu2x2" Header="2 x 2 Table" Visibility="Collapsed" GadgetType="EpiDashboard.CrosstabControl" Click="mnuGadgetMenuItem_Click"  />
                        <Controls:GadgetMenuItem x:Name="mnuMxN" Header="M x N / 2 x 2 Table" IsEnabled="True" GadgetType="EpiDashboard.CrosstabControl" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnuPMCC" Header="Matched pair case-control" IsEnabled="True" GadgetType="EpiDashboard.PMCCControl" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnuMeans" Header="Means" GadgetType="EpiDashboard.MeansControl" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnuDuplicates" Header="Duplicates List" GadgetType="EpiDashboard.Gadgets.Analysis.DuplicatesListControl" Click="mnuGadgetMenuItem_Click" />
                        <MenuItem x:Name="mnuCharts"  Header="Charts">
                            <Controls:GadgetMenuItem x:Name="mnuColumnChart" Header="Column chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.ColumnChartGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuLineChart" Header="Line chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.LineChartGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuAreaChart" Header="Area chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.AreaChartGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuPieChart" Header="Pie chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.PieChartGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuAberrationChart" Header="Aberration Detection chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.AberrationChartGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuParetoChart" Header="Pareto chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.ParetoChartGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuScatterChart" Header="Scatter chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.ScatterChartGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuHistogramChart" Header="Epi Curve chart" IsEnabled="True" GadgetType="EpiDashboard.Gadgets.Charting.HistogramChartGadget" Click="mnuGadgetMenuItem_Click" />
                        </MenuItem>
                        <MenuItem x:Name="mnuAdvStats"  Header="Advanced Statistics">
                            <Controls:GadgetMenuItem x:Name="mnuLinear" Header="Linear Regression" IsEnabled="True" GadgetType="EpiDashboard.LinearRegressionControl" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuLogistic" Header="Logistic Regression" IsEnabled="True" GadgetType="EpiDashboard.LogisticRegressionControl" Click="mnuGadgetMenuItem_Click" />
                            <MenuItem x:Name="mnuCox" Header="Cox Proportional Hazards" IsEnabled="False" Visibility="Collapsed"/>
                            <MenuItem x:Name="mnuKM" Header="Kaplan Meier Survival" IsEnabled="False" Visibility="Collapsed"/>
                            <Controls:GadgetMenuItem x:Name="mnuCSFrequency" Header="Complex Sample Frequencies" IsEnabled="True" GadgetType="EpiDashboard.ComplexSampleFrequencyControl" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuCSMeans" Header="Complex Sample Means" IsEnabled="True" GadgetType="EpiDashboard.ComplexSampleMeansControl" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuCSTables" Header="Complex Sample Tables" IsEnabled="True" GadgetType="EpiDashboard.ComplexSampleTablesControl" Click="mnuGadgetMenuItem_Click" />
                        </MenuItem>
                        <MenuItem x:Name="mnuCustomGadgets"  Header="Custom gadgets" />
                    </MenuItem>
                    <MenuItem>
                        <MenuItem.Header>
                            <TextBlock x:Name="tblockAddStatCalcGadget">Add <Run FontWeight="Bold">StatCalc</Run> Calculator</TextBlock>
                        </MenuItem.Header>
                        <MenuItem x:Name="mnuStatCalc2x2" Header="Tables (2 x 2, 2 x n)"/>
                        <MenuItem x:Name="mnuSampleSizePower" Header="Sample size and power">
                            <Controls:GadgetMenuItem x:Name="mnuPopSurvey" Header="Population survey" GadgetType="EpiDashboard.Gadgets.StatCalc.PopulationSurveyGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuCohort" Header="Cohort or cross-sectional" GadgetType="EpiDashboard.Gadgets.StatCalc.CohortGadget" Click="mnuGadgetMenuItem_Click" />
                            <Controls:GadgetMenuItem x:Name="mnuUnmatched" Header="Unmatched case-control" GadgetType="EpiDashboard.Gadgets.StatCalc.UnmatchedCaseControlGadget" Click="mnuGadgetMenuItem_Click" />
                        </MenuItem>
                        <MenuItem x:Name="mnuChiSquare" Header="Chi square for trend"/>
                        <Controls:GadgetMenuItem x:Name="mnuPoisson" Header="Poisson (Rare event vs. std.)" GadgetType="EpiDashboard.Gadgets.StatCalc.PoissonGadget" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnuBinomial" Header="Binomial (Proportion vs. std.)" GadgetType="EpiDashboard.Gadgets.StatCalc.BinomialGadget" Click="mnuGadgetMenuItem_Click" />
                        <Controls:GadgetMenuItem x:Name="mnuMatchedPairCC" Header="Matched pair case control" GadgetType="EpiDashboard.Gadgets.StatCalc.MatchedPairCaseControlGadget" Click="mnuGadgetMenuItem_Click" />
                    </MenuItem>
                    <MenuItem x:Name="mnuGrowthCharts">
                        <MenuItem.Header>
                            <TextBlock x:Name="tblockAddNutStatChart">Add <Run FontWeight="Bold">NutStat</Run> Growth Chart</TextBlock>
                        </MenuItem.Header>
                        <MenuItem x:Name="mnuNutStatCDCRecommended" Header="CDC Recommended Growth References" Visibility="Collapsed">
                            <MenuItem x:Name="mnuCDCRecommendedBMI" Header="Body mass index (BMI) for age"/>
                            <MenuItem x:Name="mnuCDCRecommendedHA" Header="Height for age"/>
                            <MenuItem x:Name="mnuCDCRecommendedHCA" Header="Head circumference for age"/>
                            <MenuItem x:Name="mnuCDCRecommendedLA" Header="Length for age"/>
                            <MenuItem x:Name="mnuCDCRecommendedWA" Header="Weight for age"/>
                            <MenuItem x:Name="mnuCDCRecommendedWH" Header="Weight for height"/>
                            <MenuItem x:Name="mnuCDCRecommendedWL" Header="Weight for length"/>
                        </MenuItem>
                        <MenuItem x:Name="mnuNutStatCDC2000" Header="CDC 2000 Growth Reference">
                            <MenuItem x:Name="mnuCDC2000BMI" Header="Body mass index (BMI) for age"/>
                            <MenuItem x:Name="mnuCDC2000HA" Header="Height for age"/>
                            <MenuItem x:Name="mnuCDC2000HCA" Header="Head circumference for age"/>
                            <MenuItem x:Name="mnuCDC2000LA" Header="Length for age"/>
                            <MenuItem x:Name="mnuCDC2000WA" Header="Weight for age"/>
                            <MenuItem x:Name="mnuCDC2000WH" Header="Weight for height"/>
                            <MenuItem x:Name="mnuCDC2000WL" Header="Weight for length"/>
                        </MenuItem>
                        <MenuItem x:Name="mnuNutStatWHOCGS" Header="WHO Child Growth Standards">
                            <MenuItem x:Name="mnuWHOCGSBMI" Header="Body mass index (BMI) for age"/>
                            <MenuItem x:Name="mnuWHOCGSHA" Header="Height for age"/>
                            <MenuItem x:Name="mnuWHOCGSHCA" Header="Head circumference for age"/>
                            <MenuItem x:Name="mnuWHOCGSMUACA" Header="Arm circumference for age"/>
                            <MenuItem x:Name="mnuWHOCGSLA" Header="Length for age"/>
                            <MenuItem x:Name="mnuWHOCGSWA" Header="Weight for age"/>
                            <MenuItem x:Name="mnuWHOCGSWH" Header="Weight for height"/>
                            <MenuItem x:Name="mnuWHOCGSWL" Header="Weight for length"/>
                        </MenuItem>
                        <MenuItem x:Name="mnuNutStatWHO2007" Header="WHO Reference 2007">
                            <MenuItem x:Name="mnuWHO2007BMI" Header="Body mass index (BMI) for age"/>
                            <MenuItem x:Name="mnuWHO2007HA" Header="Height for age"/>
                            <MenuItem x:Name="mnuWHO2007WA" Header="Weight for age"/>
                        </MenuItem>
                        <MenuItem x:Name="mnuNutStatWHO1978" Header="CDC/WHO 1978">
                            <MenuItem x:Name="mnuWHO1978HA" Header="Height for age"/>
                            <MenuItem x:Name="mnuWHO1978LA" Header="Length for age"/>
                            <MenuItem x:Name="mnuWHO1978WA" Header="Weight for age"/>
                            <MenuItem x:Name="mnuWHO1978WH" Header="Weight for height"/>
                            <MenuItem x:Name="mnuWHO1978WL" Header="Weight for length"/>
                        </MenuItem>
                    </MenuItem>

                    <MenuItem>
                        <MenuItem.Header>
                            <TextBlock x:Name="tblockAddReportGadget">Add Report Gadget</TextBlock>
                        </MenuItem.Header>
                        <MenuItem x:Name="mnuStandardTextBox" Header="Simple text box"/>
                        <MenuItem x:Name="mnuStandardImageBox" Header="Image box"/>
                    </MenuItem>
                    <Separator/>
                    <MenuItem x:Name="mnuDataDictionary" Header="Show data dictionary" IsEnabled="False" />
                    <MenuItem x:Name="mnuProperties" Header="Canvas properties" IsEnabled="False" />
                    <MenuItem x:Name="mnuAutoArrange" Header="Auto-arrange gadgets" IsEnabled="False" />
                    <MenuItem x:Name="mnuRefresh" Header="Refresh data source" IsEnabled="False">
                        <MenuItem.Icon>
                            <Image Source="Images/refresh1.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem x:Name="mnuReset" Header="Reset Dashboard" IsEnabled="False"/>
                </ContextMenu>
            </ScrollViewer.ContextMenu>


            <dashboard:DragCanvas x:Name="canvasMain" AllowDragging="True" AllowDragOutOfView="True" Width="Auto" Height="8000" MouseDown="canvasMain_MouseDown">
                <dashboard:DragCanvas.LayoutTransform >
                    <ScaleTransform x:Name="m_canvasTransform"/>
                </dashboard:DragCanvas.LayoutTransform >

                <Line x:Name="anchorLine" Stroke="Red" StrokeThickness="2" Visibility="Collapsed" />

                <StackPanel x:Name="spTitle" Visibility="Collapsed" dashboard:DragCanvas.CanBeDragged="False" Canvas.Top="100" Width="400">
                    <dashboard:WaitCursor x:Name="waitCursor" Width="25" Height="25" Visibility="Hidden" StackPanel.ZIndex="99" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0, 50, 0, 0"/>
                    <TextBlock x:Name="tblockDashboardTitle" HorizontalAlignment="Center" Text="Dashboard" Margin="0,12,0,0" FontSize="14" FontWeight="Bold"></TextBlock>
                    <TextBlock x:Name="tblockInstructions" TextAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Center" Text="Right-click on canvas to add content." Margin="0,10,0,0" FontSize="12"></TextBlock>
                    <ProgressBar x:Name="progressBar" Height="18" Margin="4, 12, 4, 8" Visibility="Collapsed" MaxWidth="150" Width="150" HorizontalAlignment="Center" />
                </StackPanel>

                <Controls:InstructionsPanel x:Name="instructionsPanel" Canvas.Top="90" Canvas.Left="100" dashboard:DragCanvas.CanBeDragged="False" Visibility="Hidden" ></Controls:InstructionsPanel>
                <Controls:LoadingPanel x:Name="loadingPanel" Canvas.Top="90" Canvas.Left="200" dashboard:DragCanvas.CanBeDragged="False" Visibility="Hidden" Panel.ZIndex="6000"></Controls:LoadingPanel>

                <DockPanel x:Name="introPanel" Canvas.Top="40" Canvas.Left="300" Width="450" Height="Auto" dashboard:DragCanvas.CanBeDragged="False">
                        <Grid>
                            <Rectangle Style="{DynamicResource shadowRectangle}"></Rectangle>
                            <Grid Background="{StaticResource PrimaryAccentColorLight}">





                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"></RowDefinition>
                                    <RowDefinition></RowDefinition>
                                    <RowDefinition Height="42"></RowDefinition>
                                    <RowDefinition Height="9"></RowDefinition>
                                </Grid.RowDefinitions>

                                <DockPanel>
                                    <TextBlock x:Name="tblockIntroPanelTitle"  FontWeight="Light" Margin="16" FontSize="32" Foreground="White">Epi Info 7 Dashboard</TextBlock>
                                </DockPanel>

                                <DockPanel Grid.Row="1">
                                    <TextBlock x:Name="tblockIntroText" FontWeight="Light" Margin="16" FontSize="18" TextWrapping="Wrap" Foreground="White">Right-click on the canvas to set a data source and add statistical gadgets. Or, open an existing dashboard canvas.</TextBlock>

                                </DockPanel>

                                <Grid Grid.Row="2">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition></ColumnDefinition>
                                        <ColumnDefinition Width="42"></ColumnDefinition>
                                        <ColumnDefinition Width="12"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock x:Name="tblockSetDataSourceNow" Grid.Column="0" FontWeight="Light" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0, 10, 25, 10" FontSize="14" Foreground="White" MouseEnter="introArrowSetDataSource_MouseEnter" MouseLeave="introArrowSetDataSource_MouseLeave" MouseLeftButtonUp="introArrowSetDataSource_MouseLeftButtonUp">Set a data source now</TextBlock>

                                    <DockPanel x:Name="introArrowSetDataSource" Grid.Column="1" Background="Transparent" MouseEnter="introArrowSetDataSource_MouseEnter" MouseLeave="introArrowSetDataSource_MouseLeave" MouseLeftButtonUp="introArrowSetDataSource_MouseLeftButtonUp">
                                        <Path Fill="White" HorizontalAlignment="Center" VerticalAlignment="Center">
                                            <Path.Data>
                                                <PathGeometry x:Name="introArrowIcon" FillRule="Nonzero" Figures="M7.34519958496094,1.19209289550781E-07L13.9831199645996,0.0134401321411133 24,10.043999671936 13.9831199645996,20.0738391876221 7.35888004302979,20.0738391876221 14.9851198196411,12.4478397369385 0,12.4478397369385 0,7.58663988113403 14.9311199188232,7.58663988113403 7.34519958496094,1.19209289550781E-07z" />
                                            </Path.Data>
                                        </Path>
                                    </DockPanel>

                                    <Ellipse Grid.Column="1" Stroke="White" StrokeThickness="2" ></Ellipse>

                                </Grid>

                            </Grid>
                        </Grid>
                    </DockPanel>

                <StackPanel Canvas.Bottom="40" Visibility="Collapsed" Canvas.Right="40" dashboard:DragCanvas.CanBeDragged="False" x:Name="panelAddSpace" MouseEnter="panelAddSpace_MouseEnter" MouseLeave="panelAddSpace_MouseLeave" MouseLeftButtonUp="panelAddSpace_MouseLeftButtonUp">
                    <StackPanel.ToolTip>
                        <ToolTip>
                            <TextBlock>Add more space to this canvas</TextBlock>
                        </ToolTip>
                    </StackPanel.ToolTip>
                    <Grid>
                        <Rectangle Style="{DynamicResource shadowRectangle}"></Rectangle>
                        <Border Style="{DynamicResource mainGadgetBorder}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>

                                <TextBlock Grid.Row="0" FontWeight="Light" FontSize="15" Foreground="DarkSlateGray" Margin="4">Add space</TextBlock>
                                <Path HorizontalAlignment="Center" Grid.Row="1" x:Name="pathAddSpace"
                              Margin="4, 4, 4, 8"
                              Fill="Gray"
                                  StrokeThickness="1"
                                  Stroke="DarkSlateGray"
                              Data="M 15 30 L 30 0 0 0 Z" IsHitTestVisible="False" VerticalAlignment="Center" />
                            </Grid>
                        </Border>
                    </Grid>                
                </StackPanel>

                <DockPanel x:Name="introAvailableData" Canvas.Top="280" Canvas.Left="300" Width="550" Height="Auto" Visibility="Collapsed" dashboard:DragCanvas.CanBeDragged="True">
                    <Border Style="{DynamicResource mainGadgetBorder}">
                    <Grid>                        
                        <Rectangle Style="{DynamicResource shadowRectangle}"></Rectangle>
                        
                            <Path x:Name="pathDataTriangle" Visibility="Collapsed" ClipToBounds="False"
                              Margin="22,-28,0,0"
                                  StrokeThickness="1"
                                  Stroke="{DynamicResource gadgetBorderBrush}"
                              Data="M 15 9 L 30 30 0 30 Z" Fill="{DynamicResource gadgetBorderBackgroundBrush}" IsHitTestVisible="False" HorizontalAlignment="Left" VerticalAlignment="Top" />
                        
                            <Grid Background="{DynamicResource gadgetBorderBackgroundBrush}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"></RowDefinition>
                                <RowDefinition></RowDefinition>
                                <RowDefinition Height="Auto"></RowDefinition>
                                <RowDefinition Height="9"></RowDefinition>
                                <RowDefinition Height="Auto"></RowDefinition>
                                <RowDefinition Height="9"></RowDefinition>
                            </Grid.RowDefinitions>

                            <DockPanel>
                                <TextBlock x:Name="tblockCanvasFiles" FontWeight="Light" Margin="10, 10, 10, 0" FontSize="22" Foreground="DarkSlateGray">Quick Access - Available Canvas Files</TextBlock>
                            </DockPanel>

                                <DockPanel Grid.Row="4">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="24"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="24"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                        <TextBlock FontSize="14" Foreground="DarkSlateGray" x:Name="tblockFindMoreCanvasFiles" Margin="10, 3, 5, 5"  MouseEnter="introArrowFindMore_MouseEnter" MouseLeave="introArrowFindMore_MouseLeave" MouseLeftButtonUp="introArrowFindMore_MouseLeftButtonUp">Browse...</TextBlock>

                                    <DockPanel x:Name="introArrowFindMore" Grid.Column="1" Background="Transparent" MouseEnter="introArrowFindMore_MouseEnter" MouseLeave="introArrowFindMore_MouseLeave" MouseLeftButtonUp="introArrowFindMore_MouseLeftButtonUp">
                                        <Path Fill="Black" HorizontalAlignment="Center" VerticalAlignment="Center">
                                            <Path.Data>
                                                    <PathGeometry x:Name="introArrowIconFindMore" FillRule="Nonzero" Figures="M3.97864985466003,5.96046447753906E-08L7.57418966293335,0.00728006660938263 13,5.44049978256226 7.57418966293335,10.8733291625977 3.98606014251709,10.8733291625977 8.11693954467773,6.7425799369812 0,6.7425799369812 0,4.10942983627319 8.08769035339355,4.10942983627319 3.97864985466003,5.96046447753906E-08z" />
                                            </Path.Data>
                                        </Path>
                                    </DockPanel>

                                    <Ellipse Grid.Column="1" Stroke="Black" StrokeThickness="1" ></Ellipse>
                                    
                                </Grid>                                
                            </DockPanel>

                            <Line Grid.Row="1" X1="10" Y1="10" X2="1540" Y2="10" Stroke="Gray" StrokeDashArray="1, 4" StrokeThickness="1" />
                                <ScrollViewer x:Name="svAvailableCanvasFiles" MaxHeight="504" Grid.Row="2">
                                    <Grid x:Name="grdRecentDataSources" Margin="5">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="32"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <Grid.RowDefinitions>
                                    <!--<RowDefinition></RowDefinition>
                                    <RowDefinition></RowDefinition>-->
                                </Grid.RowDefinitions>
                                <!--<Image Source="Images/icon_file_generic_large.png" Width="25" Height="31" Grid.Row="0" Grid.RowSpan="2" Grid.Column="0"></Image>-->
                                <!--<TextBlock Grid.Row="0" Grid.Column="1">EColi.prj</TextBlock>
                                <TextBlock Grid.Row="1" Grid.Column="1" Foreground="Gray">C:\TFSCode\Epi Info 7\Projects\EColi</TextBlock>-->
                            </Grid>
                            </ScrollViewer>
                        </Grid>
                    </Grid>
                    </Border>
                </DockPanel>

            </dashboard:DragCanvas>
            
        </ScrollViewer>

        <Controls:DataDisplayControl x:Name="dataDisplay" Grid.Row="3" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Visibility="Collapsed" />
        <Controls:DuplicatesControl x:Name="duplicatesDisplay" Grid.Row="3" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Visibility="Collapsed" />
        <Controls:VariablesDisplayControl x:Name="dataDictionary" Grid.Row="3" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Visibility="Collapsed" SelectionUnit="FullRow" />
        

        <DockPanel Grid.Row="4" Background="#9CAAC1">
        </DockPanel>

        <DockPanel Grid.Row="5" Background="#F7FAFC">
        </DockPanel>

        <DockPanel Grid.Row="6" x:Name="dockPanelBottom" Background="{StaticResource StatusStripColor}" >
            

            <DockPanel.Resources>
                <Style x:Key="statusStripStyle" TargetType="{x:Type TextBlock}">
                    <Setter Property="Margin" Value="3" />
                    <Setter Property="FontSize" Value="11" />
                </Style>
            </DockPanel.Resources>

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width=".3*"></ColumnDefinition>
                    <ColumnDefinition Width=".3*"></ColumnDefinition>
                    <ColumnDefinition MaxWidth="45" Width=".05*"></ColumnDefinition>
                    <ColumnDefinition MaxWidth="25" Width=".05*"></ColumnDefinition>                    
                    <ColumnDefinition MaxWidth="140" Width=".1*"></ColumnDefinition>
                    <ColumnDefinition MaxWidth="25" Width=".05*"></ColumnDefinition>
                    <ColumnDefinition Width="3"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock x:Name="tblockGadgetCount" FontFamily="Global User Interface" Style="{DynamicResource statusStripStyle}" Foreground="{DynamicResource textDarkGray}" Text="0 Gadgets">
                    <TextBlock.ToolTip>
                        <ToolTip x:Name="tooltipGadgets">
                          <DockPanel>                            
                            <TextBlock x:Name="tblockGadgetsDescription"></TextBlock>
                          </DockPanel>
                        </ToolTip>
                      </TextBlock.ToolTip>
                </TextBlock>                

                <Border Grid.Column="1" BorderBrush="#9CAAC1" BorderThickness="1,0,0,0">
                    <StackPanel Height="Auto" Width="1"></StackPanel>
                </Border>

                <TextBlock x:Name="tblockFieldCount" Visibility="Collapsed" Grid.Column="2"  FontFamily="Global User Interface" Style="{DynamicResource statusStripStyle}" Foreground="{DynamicResource textDarkGray}" Text="0 fields">                    
                </TextBlock>

                <!--<TextBlock x:Name="tblockCacheTime" Visibility="Collapsed" Grid.Column="3"  FontFamily="Global User Interface" Style="{DynamicResource statusStripStyle}" Foreground="{DynamicResource textDarkGray}" Text="Data set load time: 15 seconds">
                </TextBlock>-->

                <Grid Grid.Column="3" >
                    <DockPanel HorizontalAlignment="Right">
                        <Controls:StatusBarBordersButton x:Name="statusStripButtonShowBorders" Margin="1,0,1,0">
                            <Controls:StatusBarBordersButton.ToolTip>
                                <StackPanel>
                                    <Label Loaded="HideBorderLabel_Loaded" FontWeight="Bold">Hide Gadget Borders Button</Label>
                                    <TextBlock Loaded="HideBorderText_Loaded"
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Toggles the display of gadget borders and any buttons on the gadget's border.
                                    </TextBlock>
                                </StackPanel>
                            </Controls:StatusBarBordersButton.ToolTip>
                        </Controls:StatusBarBordersButton>
                        <Controls:StatusBarArrangeButton x:Name="statusStripButtonVerticalArrange" Margin="1,0,1,0">
                            <Controls:StatusBarArrangeButton.ToolTip>
                                <StackPanel>
                                    <Label Loaded="VertArrangeLabel_Loaded" FontWeight="Bold">Vertical Arrange Button</Label>
                                    <TextBlock Loaded="VertArrangeText_Loaded"
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Toggles a vertical stacking of gadgets. When gadgets are in vertical stack mode, they are automatically positioned and the user cannot re-position them.
                                    </TextBlock>
                                </StackPanel>
                                </Controls:StatusBarArrangeButton.ToolTip>
                        </Controls:StatusBarArrangeButton>
                    </DockPanel>
                </Grid>

                <TextBlock x:Name="tblockZoom" FontFamily="Global User Interface" Grid.Column="4" Style="{DynamicResource statusStripStyle}" Foreground="{DynamicResource textDarkGray}">100%</TextBlock>
                <Controls:CircularButton x:Name="buttonZoomOut" Height="16" Width="16" HasMinusSymbol="False" Grid.Column="5" MouseLeftButtonUp="buttonZoomOut_MouseLeftButtonUp"></Controls:CircularButton>
                <Controls:CircularButton x:Name="buttonZoomIn" Height="16" Width="16" HasMinusSymbol="True" Grid.Column="7" MouseLeftButtonUp="buttonZoomIn_MouseLeftButtonUp"></Controls:CircularButton>
                <Slider IsSnapToTickEnabled="True" Margin="0,0,0,0" TickFrequency="5" x:Name="sliderZoom" Grid.Column="6" Value="100" Minimum="50" Maximum="200" SmallChange="5" LargeChange="25" TickPlacement="BottomRight"  VerticalAlignment="Center" ValueChanged="sliderZoom_ValueChanged"></Slider>
            </Grid>

        </DockPanel>
    </Grid>
    
    
</UserControl>
